package Threads.GeekBang_test;


//Long类型-享元模式
//具体看valueOf方法，会缓存从-128-127的值的Long对象
public class test_28 {
    public static void main(String[] args) {
        long l=10;
        Long l1 = Long.valueOf(l);
        Long l2 = Long.valueOf(l);
        //true
        System.out.println(l1==l2);
        long ll=1000;
        Long ll1 = Long.valueOf(ll);
        Long ll2 = Long.valueOf(ll);
        //false
        System.out.println(ll1==ll2);
    }
}
